﻿using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.报表.service
{
    public partial class Form备货对照表 : DevExpress.XtraEditors.XtraForm
    {
        public Form备货对照表()
        {
            InitializeComponent();
            this.refreshData();
        }

        public void refreshData()
        {
            //  备货对照表
            this.gridControl备货对照表.DataSource = 抖音报表service.get备货对照表();
            this.gridView备货对照表.RefreshData();  
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            //this.gridView抖音客户订单.ExportToXlsx(@"D:\导出excel\新建 Microsoft Excel 工作表.xlsx");//固定地址导出文件
            SaveFileDialog fileDialog = new SaveFileDialog();
            fileDialog.Title = "导出Excel";
            fileDialog.Filter = "Excel文件(*.xls)|*.xls";
            DialogResult dialogResult = fileDialog.ShowDialog(this);
            if (dialogResult == DialogResult.OK)
            {
                DevExpress.XtraPrinting.XlsExportOptions options = new DevExpress.XtraPrinting.XlsExportOptions();
                this.gridView备货对照表.ExportToXls(fileDialog.FileName);
                DevExpress.XtraEditors.XtraMessageBox.Show("保存成功！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //选择地址保存文件
            }
        }
    }
}